//
//  YYFMDBManger.swift
//  STMusic
//
//  Created by stoneobs on 2017/6/23.
//  Copyright © 2017年 stoneobs. All rights reserved.
//

import UIKit

class YYFMDBManger: NSObject {
    
    static var shared = YYFMDBManger();

    private  override init() {
    
        print("沙盒\(NSHomeDirectory())");
    }
    //创建一个数据库，如果有就不创建，返回这个数据库
    func cgreateDB(name:String) -> FMDatabase {
        let path = NSSearchPathForDirectoriesInDomains(FileManager.SearchPathDirectory.documentDirectory, FileManager.SearchPathDomainMask.userDomainMask, true).first;
        
        let db =   FMDatabase(path:path! + "/" + name);
        db?.open();
        return db!;
    }
}
